<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
    <title>3DTiles模型</title>
    <style>
        body {
            position: absolute;
            margin: 0;
            width: 100%;
            height: 100%;
        }

        #mapContainer {
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            float: left;
        }
    </style>
</head>

<body>

    <div id="mapContainer" style="position: relative;">
    </div>

</body>
<script src='/GiswayEngine.js'></script>
<script type="text/javascript">
    window.app = new GE.App('mapContainer', {
        position: [118.14118571593596,36.775558894322735, 12000],
        lookAt: [118.14118571593596,36.775558894322735, 0],

        cameraScrollSpeed: 15,
        minZoom: 3,
        maxZoom: 20,
        cameraFov: 15, //相机的fov

        ambientLightIntensity: 2,
        ambientLightcolor: 0xffffff,//环境光照的颜色
        ambientLightType: 'ambient',//环境光照的类型，有如下类型:ambient，hemisphere
        supportLightType: 'single',//方向光的类型，有如下类型:single，double，tripple
        supportLightIntensity: 1,//方向光的强度
        supportLightcolor: '#ffffff', //方向光的颜色
        lightDistance: 2000,//方向光源距离初始相机target的距离
        lightHeight: 50,//方向光源的高度

        useCarpet: true,
        background: "none",
        useDefaultTexture: true, //是否使用瓦片默认纹理
        baseLayer: [
            {
                url: ' https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
                // url:'https://gis5.ldwzh.com:28015/pj16/{z}/{x}/{y}.png',
                readableUrl: true,
                tileType: 'image',
                maxDataLevel: 17
            },
        ]
    });

    var threeTileModel;
    tiles3d();
    function tiles3d() {
        threeTileModel = new GE.Tiles3d({
            url: 'http://192.168.2.44:9000/examples/resources/3dtiles/performanced_old_3dtiles/tileset.json', refinement: 10, loadRange: 400,
            z: 0, //调整数据的高度
            minSize: 4000,
            maxSize: 8000,
            isOpenAdditionalCamera: true, //是否添加预加载的额外相机
            additionCameraFov: 30, //额外相机的fov
            maxJobs: 3000,
            canNotSelect: true, //true表示该图层不参与射线拾取，false表示图层参与射线拾取
            isSupportTransparent: false,
            maxSlopeAngle: 25, //最大斜坡角度
        });
        app.add(threeTileModel);
        window.tiles3d = threeTileModel;
    }

    window.app.on('Click', function (e) {
        console.log(e);
    });

    window.app.on('ZoomChange', function (e) {
    });

</script>

</html>